import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import Login from '@/views/login/index.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/login',
      name: 'Login',
      meta: { hideInMenu: true, public: true },
      component: Login
    },
    {
      path: '/:catchAll(.*)',
      redirect: '/notFound',
      meta: { hideInMenu: true }
    },
    {
      path: '/notFound',
      name: 'notFound',
      component: () => import('@/views/404.vue'),
      meta: { hideInMenu: true, public: true }
    }
  ]
})

export default router
